package service

import (
	"context"
	"gitee.com/gopher2011/godemo/logger"
	"os"
)

func GetLogger (ctx context.Context)*logger.Logger{
	if ctx == nil {
		return logger.New(os.Stdout)
	}
	instance,ok := ctx.Value("logger").(*logger.Logger)
	if ok {
		return instance
	}
	return logger.New(os.Stdout)
}
